fig3a_data = readtable('fig3a.csv');
fig3b_data = readtable('fig3b.csv');
fig3c_data = readtable('fig3c.csv');

figure('position',[360,60,450,600]);
%%
w = fig3a_data{2:end,1}; w = w(:).';
wa = fig3a_data{1,2:end}; wa = wa(:).';
fig3a = fig3a_data{2:end,2:end};

CM = zeros(9999,3);
I = linspace(0,max(fig3a(:)),size(CM,1));
CM(:,1) = min(I,1); CM(:,3) = double(CM(:,1)==1).*(1+(1-I)/(max(fig3a(:))-1)).' + double(CM(:,1)~=1);
CM(:,2) = min(CM(:,1),CM(:,3));
CM(1,:) = 0.8;

imagesc(wa,w,fig3a);
axis equal; xlim(minmax(wa)); ylim(minmax(w));
colormap(CM); clim([0,max(fig3a(:))]);
grid on;
xlabel('Larmor Frequency \omega_a [Hz]');
ylabel('Two-Photon Detuning \omega [Hz]             ');
set(gca,'fontsize',11,'xtick',500*(-5:1:5),'ytick',500*(-5:1:5),...
    'position',[0.2,0.27+0.14,0.6,0.6],'ydir','normal','XTickLabelRotation',20);
hold all;
F = 9.8126e-5*wa.^2-0.014533*wa+41.2241;
plot([wa,nan,wa,nan,wa,nan,wa],[-wa+F,nan,-wa-F,nan,wa+F,nan,wa-F],'-.k');
CB = colorbar; set(CB,'position',[0.2+0.6+0.05,0.27+0.12+0.025,0.0371,0.49]);
text(2000,2000,'$|1-\mathcal{C}|$','interpreter','latex','fontsize',11);

plot(wa(59) + 50*[-1,0,1,nan,0,0,nan,-1,0,1,nan,0,0],...
    1e3*[-1,-0.9,-1,nan,-1.2,-0.9,nan,1,0.9,1,nan,1.2,0.9],'-k','linew',1);

text(-2670,2250,'{\bfa}','fontsize',12);

%%
axes('position',[0.2-0.04,0.1,0.31,0.2]);

plot(fig3b_data{:,1},fig3b_data{:,2},...
    'o','MarkerSize',3,'linew',1,'Color',[0.85 0.325 0.098],...
    'MarkerEdgeColor',[0.85 0.325 0.098],'MarkerFaceColor',[0.9402 0.6202 0.4818]);
hold all;
plot(fig3b_data{:,1},fig3b_data{:,3},...
    'o','MarkerSize',3,'linew',1,'Color',[0 0.447 0.741],...
    'MarkerEdgeColor',[0 0.447 0.741],'MarkerFaceColor',[0.0745,0.6235,1]);

set(gca,'fontsize',11);
hold all;
ylim([0,850]);
xlabel('\omega_a [Hz]');
ylabel('FWHM [Hz]');
grid on;
set(gca,'xtick',1000*(-2:2),'xticklabel',{'-2000','','0','','2000'},'xticklabelrotation',0);
text(-2000-2*700,920,'{\bfb}','fontsize',12);

plot(fig3b_data{59,1}*[1,1],[fig3b_data{59,2},fig3b_data{59,3}],...
    'o','MarkerSize',3,'linew',1,'Color',[0 0 0],...
    'MarkerEdgeColor',[0 0 0],'MarkerFaceColor',[0 0 0]);
plot(267.7658 + 80*[-1,0,1,nan,0,0],...
    200*[1.1,0.9,1.1,nan,1.4,0.9],'-k','linew',1);

plot(fig3b_data{:,4},fig3b_data{:,5},'-','linew',0.8,'color',[126,47,142]/255);
plot(fig3b_data{:,4},fig3b_data{:,6},':','linew',1.5,'color',zeros(1,3));

%%
axes('position',[0.2-0.04+0.45,0.1,0.31,0.2]);

plot(fig3c_data{:,1},fig3c_data{:,2},...
    'o','MarkerSize',3,'linew',1,'Color',[0.85 0.325 0.098],...
    'MarkerEdgeColor',[0.85 0.325 0.098],'MarkerFaceColor',[0.9402 0.6202 0.4818]);
hold all;
plot(fig3c_data{:,1},fig3c_data{:,3},...
    'o','MarkerSize',3,'linew',1,'Color',[0 0.447 0.741],...
    'MarkerEdgeColor',[0 0.447 0.741],'MarkerFaceColor',[0.0745,0.6235,1]);
set(gca,'fontsize',11);
ylim([0,1.3]);
xlabel('\omega_a [Hz]');
ylabel('$|\mathcal{C}|$','interpreter','latex');
grid on;
box on;
set(gca,'xtick',1000*(-2:2),'xticklabel',{'-2000','','0','','2000'},'xticklabelrotation',0)
text(-2000-2*650,920/850*1.3,'{\bfc}','fontsize',12);

plot(267.7658*[1,1],[fig3c_data{59,2},fig3c_data{59,3}],...
    'o','MarkerSize',3,'linew',1,'Color',0*[0.85 0.325 0.098],...
    'MarkerEdgeColor',0*[0.85 0.325 0.098],'MarkerFaceColor',0*[0.9402 0.6202 0.4818]);
plot(267.7658 + 80*[-1,0,1,nan,0,0],...
    0.9-200/800*1.1*[1.1,0.9,1.1,nan,1.4,0.9],'-k','linew',1);

plot(fig3c_data{:,4},fig3c_data{:,5},'-','linew',0.8,'color',[126,47,142]/255);
plot(fig3c_data{:,4},fig3c_data{:,6},':','linew',1.5,'color',zeros(1,3));
